UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'afg4xx2ERnu81qJhVO8JR4TbZzMWvskywOTzWBtHvyM='
WHERE
key_id = 'bac803bfccde3ba55015ba6952054ae0e2d9a0460585c2811d50fc67ab62e0bd'
AND (
token = 'afg4xx2ERnu81qJhVO8JR4TbZzMWvskywOTzWBtHvyM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)