UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '36ZbXbPSRfkrru87qD2x3QVB3OCizyEXt+h2OJOzFwo='
WHERE
key_id = 'cb259df02d4675ca3468cce285c797f671ced8c48f2f64c74f455afe671138c4'
AND (
token = '36ZbXbPSRfkrru87qD2x3QVB3OCizyEXt+h2OJOzFwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)