UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oxZCAZRnkaeKa3OH4m3H4fSviWvrOCIBD8kN9hUSY1s='
WHERE
key_id = '9090427c51cf25a6b7fde1c5e1b9779fe0bc9c842c85fffde31be701adfb7fb1'
AND (
token = 'oxZCAZRnkaeKa3OH4m3H4fSviWvrOCIBD8kN9hUSY1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)