UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Kswu9rl+v2flVMkveXlzVHKwoz3yJf+QCF9YW9LdV8='
WHERE
key_id = '3c35adf1ddbfeea303df1a18c225f5aa3438b7ed5bda06fabb137fed4bc928a5'
AND (
token = '9Kswu9rl+v2flVMkveXlzVHKwoz3yJf+QCF9YW9LdV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)