UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eBM3xY0HA2VPzJl4AsUtBjOBZBhnOZAVgz85npFk46g='
WHERE
key_id = '7681ef09d3524ed7ccf21f356ba130735a99c1f08b05523c1865ffadd6c8a3ec'
AND (
token = 'eBM3xY0HA2VPzJl4AsUtBjOBZBhnOZAVgz85npFk46g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)