UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jf/2SIglJSas8E/fkr3EdKoeLpzRsKrmtlBgzAuWE5U='
WHERE
key_id = 'cdacf1c097a86a6ca3384d3caa597cdaf9091e982a9929c25cfe2588b2f89ada'
AND (
token = 'Jf/2SIglJSas8E/fkr3EdKoeLpzRsKrmtlBgzAuWE5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)