UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2oMTchHIuDlO2QqiKPCtH3lOoJ3ePGcKquASYWUa9Y0='
WHERE
key_id = '26ae452b25f204d5d989d94d0035298e963685186be5b0ba0c9ffaa7ddf7c251'
AND (
token = '2oMTchHIuDlO2QqiKPCtH3lOoJ3ePGcKquASYWUa9Y0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)