UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6TrQOkmJ4qgifD31ICQhfWij3+/h8ssLrA/Dy4CVRAo='
WHERE
key_id = '0b6e78ba3dc87b7aad16780be1738d62bc3d0198ee27614f7220cdd2e3b73d97'
AND (
token = '6TrQOkmJ4qgifD31ICQhfWij3+/h8ssLrA/Dy4CVRAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)