UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6OoYocOC9klLCCKat2psaeYLJFye+LEgfhPIr6Sg6kc=' 
WHERE 
  key_id = '25d81e0aa7ee5bc4672bd7ec47cdb1ed3cd6203b193c1245e30ad19890b23683' 
  AND (
    token = '6OoYocOC9klLCCKat2psaeYLJFye+LEgfhPIr6Sg6kc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021