UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/w5eT08VxMsm6iGzeoH6jM+ISLmQNu31lA2X11vJZkM='
WHERE
key_id = 'a575f6897d49f1b6fa9658e74a157687eb1f6e28dba264fc526de4c67eaaaeda'
AND (
token = '/w5eT08VxMsm6iGzeoH6jM+ISLmQNu31lA2X11vJZkM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)