UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yxDejdxWppmdEhDFsxjJWTH3fsH+ICGXNED2PySs0Eg='
WHERE
key_id = '406c938d2c69f2e5a7684243595ae3ea5366d98ea7cc551624fa39eae91e83cf'
AND (
token = 'yxDejdxWppmdEhDFsxjJWTH3fsH+ICGXNED2PySs0Eg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)