UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xl0oWhPZ2vuJaOY0vP+OhO+JdleYo27UlkUIDd/7G7g=' 
WHERE 
  key_id = 'b3c33a824a2ef0fab55fbbf69e81f40f739557006b9a2800a1eb6f2670d00537' 
  AND (
    token = 'Xl0oWhPZ2vuJaOY0vP+OhO+JdleYo27UlkUIDd/7G7g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025