UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XpR+S3B7qJF6rM0nhJe2AhcW0chyitpOsxO9VOBo4d4='
WHERE
key_id = '7695c154397353736a7f64b108ef5ca10f2baa286513e8e2441379514b0b1eea'
AND (
token = 'XpR+S3B7qJF6rM0nhJe2AhcW0chyitpOsxO9VOBo4d4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)