UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mM4D4AMH0+ye3nLKSsw2cPbucUSrdM6BOa71PccZ9js='
WHERE
key_id = '4f2814b81bcfbe75112ba6659375864812071a1ca4c92d3edc18ac2fd2495a08'
AND (
token = 'mM4D4AMH0+ye3nLKSsw2cPbucUSrdM6BOa71PccZ9js='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)