UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7zqy5CKSj7AtU/YZRC0RD0HG4Wu70EWzQ2ZTRTynP9c='
WHERE
key_id = 'f19703d5ef66a732959f827bebf645f0fb2c83dafed87fc42d4d5d8f9db115b8'
AND (
token = '7zqy5CKSj7AtU/YZRC0RD0HG4Wu70EWzQ2ZTRTynP9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)