UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4/fqU6xgR7xWfAqgpe74Dtzg/VPq3aVxPzIx1yvIf8g='
WHERE
key_id = 'e56e19b88ffaf7928921280cdbde1527ce3d5c838cc87000f112f2a66728923f'
AND (
token = '4/fqU6xgR7xWfAqgpe74Dtzg/VPq3aVxPzIx1yvIf8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)