UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W3fdoIF0YVtH0v3vzprK4bRLvENbzKnnucetNzOB65c='
WHERE
key_id = '764fccbbc59d9ab79d3e4883ef09de9fa1f8ffec07c1e35a51f22978ef72bb98'
AND (
token = 'W3fdoIF0YVtH0v3vzprK4bRLvENbzKnnucetNzOB65c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)