UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NRqLcpjhWd8ubg2c265uYgYSIiIQHd/8dGBgjmLBBAw='
WHERE
key_id = '3286e3e608d4b0bd5cc32c3c43571298ac2e3aaed1dd6b39614ab2281cb6383b'
AND (
token = 'NRqLcpjhWd8ubg2c265uYgYSIiIQHd/8dGBgjmLBBAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)