UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'syZ5Am+fIcS/W+bmn3J8TthzVbJdGX9rfXd4NMX4Qjs='
WHERE
key_id = 'fec7a4e365432e0a3ffb6531d740f74033b69eca0b5046e08c976f927774c752'
AND (
token = 'syZ5Am+fIcS/W+bmn3J8TthzVbJdGX9rfXd4NMX4Qjs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)