UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vJ0S3YptZ0wpwPDgLI92GeHTbMLb2u8eDa+1Oyn47aE='
WHERE
key_id = 'f906d8cc16f133bf21a1150b0504eec7efbf58eef30dd9cc9495653c4e40c276'
AND (
token = 'vJ0S3YptZ0wpwPDgLI92GeHTbMLb2u8eDa+1Oyn47aE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)