UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IfsvD3wY+6skQ6m7YzIqYvV0P3pv1dSAbJppkF6eebM='
WHERE
key_id = '2c3e86dd164bdca5a5ca0c7c97b6ee6f84d552df1b1d86c63249a7cfcfc1c4ce'
AND (
token = 'IfsvD3wY+6skQ6m7YzIqYvV0P3pv1dSAbJppkF6eebM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)