UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iFTZQK5w2vL+5mrCtNol2xOdjltoi6KfDXrhowNOiXU='
WHERE
key_id = 'f6132f21ed1a6cd3e0661448539223ad18c39e7556bdaf2cfe6586ca3770cf9a'
AND (
token = 'iFTZQK5w2vL+5mrCtNol2xOdjltoi6KfDXrhowNOiXU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)