UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ESgi7G0Y95M8zXGNiubBMo8lb/qvUVZQItLoyPkLSKg='
WHERE
key_id = '4a83ba99ab1b463ef15bfc55d6c052c89c1bc5770006b26a6acd71833240c3d7'
AND (
token = 'ESgi7G0Y95M8zXGNiubBMo8lb/qvUVZQItLoyPkLSKg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)