UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'evqs+8zJ8HD44NUJxagWkx95nLvW6EGWA6BSj5tok74='
WHERE
key_id = 'b002280e7cc1dccc72229e8e6d2c0e237266e0dccbfc336f7f2629ba7e89f9ee'
AND (
token = 'evqs+8zJ8HD44NUJxagWkx95nLvW6EGWA6BSj5tok74='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)