UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mfO7ysHWBbCmasFZEpjZsNdi1IMNiCrTQmLlzgEv2pg='
WHERE
key_id = '58745b5f9dbca9ce5091b875ac69ffaa77a5b96a9ee25dde7e63c7ed9b63ef16'
AND (
token = 'mfO7ysHWBbCmasFZEpjZsNdi1IMNiCrTQmLlzgEv2pg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)