UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XEf8EioqoW3vMGKzmIgG3qH6VNczbXlWof/Q/SbjSpo='
WHERE
key_id = 'd4f826b43242bbae98ac8d3ed9021957edc18f431bbce6ed15d53342a8e9b269'
AND (
token = 'XEf8EioqoW3vMGKzmIgG3qH6VNczbXlWof/Q/SbjSpo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)