UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tEaQ7AYc1lvdVC4e8r8s5c/vPaEB5gIJmVB7ZIf0VeU='
WHERE
key_id = '2955b16f6300c9d8b733302ca425f3b661ef16dced2db21450ae1ba79a01a6df'
AND (
token = 'tEaQ7AYc1lvdVC4e8r8s5c/vPaEB5gIJmVB7ZIf0VeU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)