UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CrwBOjRPnrpTO9iH/lqh5y06zCFPSd4pXMPmzj9yYRA='
WHERE
key_id = 'ab5cc4fe84aaa0359f303baabbf7f1ce2d9b2559264d71a90ff97fee31427b4b'
AND (
token = 'CrwBOjRPnrpTO9iH/lqh5y06zCFPSd4pXMPmzj9yYRA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)