UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TQeR2JOzRb2232ikERd8sScBjI31NteyouK3UUiMv1A='
WHERE
key_id = 'efb966495200349efc6269a9a456073dc517b574e2e1ceb19486b1dcc0e80e30'
AND (
token = 'TQeR2JOzRb2232ikERd8sScBjI31NteyouK3UUiMv1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)