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