UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YfkpXP3UWFgMP5YTDiOjs0PsMiCAr6EWUfalTZI8xQI='
WHERE
key_id = '6b1d599c669c4b076356c8931f96dbc40ddbaaa6fc9bb4349a1bda4c5e213e26'
AND (
token = 'YfkpXP3UWFgMP5YTDiOjs0PsMiCAr6EWUfalTZI8xQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)