UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R7lgHdL7WtdbdfBXd0HMS58CB5oKfSgLCmLQCFiK3H0='
WHERE
key_id = 'f370ec707f6d2d3044cc4ef898359e625a1fb4e8ef0a6b8f185883df894b980d'
AND (
token = 'R7lgHdL7WtdbdfBXd0HMS58CB5oKfSgLCmLQCFiK3H0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)